﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using ScrumTable.UI.View.Extension;

#endregion

namespace ScrumTable.UI.View.Converter
{

    /// <summary>
    /// bool -> RadialGradientBrush (Opacitymask)
    /// </summary>
    [ValueConversion(typeof(bool), typeof(GradientBrush))]
    public class OpacitymaskConverter : IValueConverter
    {

     
        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(!(value is bool))
                return null;

            var enable = (bool) value;

            if(enable)
            {
                return Application.Current.Resources["disabledMaskLinar"];   
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();

        }
       
        #endregion

    
       
    }
}
